package org.friut.app.dwz;

/**
 * DWZ 组件专用
 * 
 * @author Tang
 */
public class DwzAction extends DwzPagination {

	private static final long serialVersionUID = -6883859701339629207L;

	/**
	 * Reset Pagination 
	 */
	public void resetPage(int totalCount) {
		this.totalCount = totalCount;
		pageCount = totalCount % numPerPage == 0 ? totalCount / numPerPage
				: totalCount / numPerPage + 1;

		// 设置分页使用的start和limit
		start = Math.max(0, pageNum - 1) * numPerPage;
		limit = numPerPage;
	}
}
